
public class Box {

	private double length , width , height;

	public Box(double length , double width , double height) throws IllegalArgumentException {
		if(length <= 0 || width <= 0 || height <= 0)
			throw new IllegalArgumentException("Error: Dimension <= 0");

		this.length = length;
		this.width  = width;
		this.height = height;
	}

	public Box(double length) throws IllegalArgumentException {

		this.length = length;
	}

	public Box (Box b1) {
		length = b1.length;
		width  = b1.width;
		height = b1.height;
	}

	public String toString() {
		return "Length: " + this.length + ", Width: " + this.width + ", Height: " + this.height;
	}
	
	public boolean equals1(Object other) {
		if(other == null)
			return false;
		else if (getClass() != other.getClass() )
			return false;
		else {
			Box otherBox = (Box) other;
			return  otherBox.height == this.height;
		}
	}





	public double volume() {     		
		return length * width * height;	
	}

	public double surfaceArea() {
		return 2 * (length * width + length * height + width * height);	
	} 


	public void setLength (double length) {
		if (length <= 0 )
			throw new IllegalArgumentException("Error: Dimension <= 0");

		this.length = length;
	}

	public void setWidth (double width) {
		if (width <= 0)
			throw new IllegalArgumentException("Error: Dimension <= 0");

		this.width = width;
	}

	public void setHeight (double height) {
		if (height <= 0 )
			throw new IllegalArgumentException("Error: Dimension <= 0");

		this.height = height;
	}

	public double getLength() {
		return this.length;
	}

	public double getWidth() {
		return this.width ;
	}

	public double getHeight() {
		return this.height ;
	}


}
